import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { BaseService, CoolCommException } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository, In } from 'typeorm';
import { UserInfoEntity } from '../../user/entity/info';
import { Context } from '@midwayjs/koa';
import { PluginService } from '../../plugin/service/info';
import axios from 'axios';
import { AdvertisementEntity } from '../entity';

/**
 * 广告
 */
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class AdvertisementService extends BaseService {
  @InjectEntityModel(AdvertisementEntity)
  advertisementEntity: Repository<AdvertisementEntity>;

  @InjectEntityModel(UserInfoEntity)
  userInfoEntity: Repository<UserInfoEntity>;

  @Inject()
  ctx: Context;

  @Inject()
  pluginService: PluginService;
}
